home *** CD-ROM | disk | FTP | other *** search
- { TPBoard 4.2 Copyright (c) 1987,88 by Jon Schneider & Rick Petersen
- Portions Copyright (c) 1986,87 by Steve Fox and Les Archambault
-
- Last modified :: 9-13-88 7:02 pm
- }
-
- {$R-} {Range checking off}
- {$B-} {Boolean complete evaluation off}
- {$S-} {Stack checking off}
- {$I+} {I/O checking on}
- {$N-} {No numeric coprocessor}
-
- Unit Globals;
-
- Interface
-
- Uses
- TPCrt, Dos, TPASCIIZ, TAccess;
-
-
- const
- version = 'TPBoard 4.2';
- ver_date = '09/15/88';
-
- def_maxfree_uplds = 50; { #K disk space left when uplds will be disabled}
- def_maxfree_logs = 25; { #K " " " " logins will be disabled}
- def_maxfree_mslimit = 20; { #K left when msgs will be limited to maxfree_lines}
- def_maxfree_lines = 10; { # lines allowed when msgs are limited by disk space}
- def_maxfree_abs = 5; { when this amount of space remains, all mesg entering restricted}
- def_uval_acc = 20; { Default access level }
- def_uval_time = 20; { Default time limit }
- def_chars = 80; { Default characters per line }
- def_lines = 22; { Default lines per page }
- def_val_acc = 50; { Access level for validated users }
- def_val_time = 50; { Time limit for validated users }
- def_chat_ok = True; { allow chat function}
- def_ChatStart = 00; { Chat hours }
- def_ChatEnd = 24;
- dir_fence = '|'; { Character between directory columns }
- def_unv_days = 61; { Days to retain unvalidated user }
- def_val_days = 180; { Days to retain validated user }
- def_unr_days = 60; { Days to retain unread, undeleted messages }
- def_rea_days = 30; { Days to retain read, undeleted messages }
- def_Max_Tries = 4; { Max number of tries for password }
- deflt_macro = 'P;A;S;LOGIN;G'; { DEFAULT MACRO STRING, ^M=CR }
- def_auto_macro_start = 4; { auto macro start time}
- def_restrict300 = True; { restrict 300 baud callers}
- def_start_restrict300 = 17;
- def_end_restrict300 = 24;
- def_modem_answer = False; { don't let modem answer phone}
- def_auto_macro = True; { no auto macro processing}
- def_limit_lines = False; { limits number of lines in messages}
- def_max_msg_lines = 100; { when restricted only}
- def_restrict_public = False; { requires sysop release for public msgs.}
- def_up_down_ratio = 20; { downloads per upload, 0=no restriction}
- def_sleepy_time = 300; { input timeout in seconds}
- def_extra_time_val = 20; { extra minutes on sys allowed at certain ties}
- def_extra_time_start = 2; { hour tostart extra time on system}
- def_extra_time_stop = 6; { hour extra time stops}
- def_extra_time = True; { extra time enabled}
- def_down_ok = False; { can new users download}
- def_new_days = 30; { days for files to age in Newin }
- def_answer_delay = 500; { delay between ring and answer}
- def_com_port = 1; { com port to use}
- def_modem_rate = 300; { rate to communicate with modem}
- def_ok_str = '0'; { result codes}
- def_ring_str = '2';
- def_connect300 = '1';
- def_connect1200 = '5';
- def_connect2400 = '10';
- def_connect9600 = '13';
- def_connect1200ecc = '15';
- def_connect2400ecc = '16';
- def_connect9600ecc = '17';
- def_error_str = '4';
- def_init_str = '|~ATZ|~~ATX4Q0H0M0V0E1S2=255|';
- def_off_hook_str = 'ATH1|';
- def_answer_str = 'ATA|';
- def_hang_up_str = 'ATH0|';
- def_attention = 255;
- def_question = 'Do you want IBM Color Graphics';
- def_disp_dir = True;
- def_line_abort = 250;
- def_format = True;
-
- { File names }
-
- user_data = 'USERDAT'; { User data }
- user_indx = 'USERIDX'; { Index to user data }
- area_indx = 'NEWAIDX'; { Index to NEWIN by area }
- name_indx = 'NEWNIDX'; { Index to NEWIN by filename }
- logr_name = 'LOG'; { Log file }
- mesg_name = 'MESSAGE'; { Messages }
- summ_name = 'SUMMARY'; { Summaries }
- sysm_name = 'SYSMSG'; { System messages }
- sect_name = 'SECTION'; { Section names }
- stat_name = 'STATS'; { Statistics }
- nwin_name = 'NEWIN'; { New uploads list }
- nsum_name = 'SUMM'; { NetMail summary file }
- ext = '.BB#'; { File type }
-
- { ASCII constants }
-
- NUL = #$00;
- SOH = #$01;
- STX = #$02;
- ETX = #$03;
- EOT = #$04;
- ENQ = #$05;
- ACK = #$06;
- BEL = #$07;
- BS = #$08;
- TAB = #$09;
- LF = #$0A;
- VT = #$0B;
- FF = #$0C;
- CR = #$0D;
- DC1 = #$11;
- DC3 = #$13;
- NAK = #$15;
- CAN = #$18;
- ESC = #$1B;
- SPC = #$20;
- RUB = #$7F;
- XON = $11;
- XOFF = $13;
- SoftCR = #$8D;
- LeftArrow = #$CB; { extended scan code + hi bit set }
- EndKey = #$CF; { extended scan code + hi bit set }
- DelKey = #$D3; { extended scan code + hi bit set }
-
- { Used for Fido Mail }
-
- def_node = 23;
- def_net = 381;
- def_zone = 1;
- def_fidomail = 'C:\MAIL\MESSAGES';
- def_fidolists = 'C:\MAIL';
- def_fido_sysop = 'Jon Schneider';
- echo_name = 'ECHO';
- netlist = 'NETLIST.TPB';
- nodelist = 'NODELIST.TPB';
-
- { Used for Quotes mod }
-
- quot_name = 'QUOTES'; {file name of QUOTES.BB#}
- qidx_name = 'QUOTEIDX'; {file name of QUOTIDX.BB#}
-
-
- { Used for external protocols and ANSI graphics }
-
- sysmg_name = 'SYSMSGG';
- ZmdmLogName = 'DSZ.LOG'; { Log file name for DSZ }
-
-
- { TPBoard constants }
-
- len_fn = 10; { length of firstname }
- len_ln = 15; { length of lastname }
- len_name = 25; { sum of above }
- len_ad = 20; { length of address }
- len_cy = 20; { length of city }
- len_st = 2; { length of state abbreviation }
- len_ph = 12; { length of phone number }
- len_pw = 10; { length of password }
- len_subj = 56; { length of subject }
- len_msg = 72; { length of message }
-
- message_mode = 1;
- files_mode = 2;
- utility_mode = 3;
- sysop_mode = 4;
- pr_msg : array[1..4] of string[7] = ('Message', 'Files', 'Utility', 'Sysop');
-
- type
-
- record_status = (deleted, seen, private, public, restricted);
- UpCreditType = (Points, Kilobytes, Files);
-
- Str3 = string[3];
- Str5 = string[5];
- Str10 = string[10];
- DosFileName = string[12];
- Str13 = string[13];
- Str14 = string[14];
- StrTAD = string[27];
- StrPr = string[50];
- StrDesc = string[78];
- StrStd = string[80];
- Str100 = string[100];
- StrName = string[len_name];
- FirstName = string[len_fn];
- LastName = string[len_ln];
- address = string[len_ad];
- city = string[len_cy];
- state = string[len_st];
- phone = string[len_ph];
- password = string[len_pw];
- subject = string[len_subj];
- message = string[len_msg];
-
- tad_array = array[0..5] of Byte;
- name_array = array[1..11] of Byte;
- hour_array = array[0..23] of Integer;
- day_array = array[0..6] of Integer;
- fname_array = array[1..10] of DosFileName;
- last_read_arry = array[0..63] of Integer;
-
-
- SysmPtr = ^SysmRecord;
- SysmRecord =
- record
- key : Char; { Key value }
- loc : Integer; { Location of record in file }
- next : SysmPtr { Pointer to next element on list }
- end;
-
- MesgPtr = ^MesgRecord;
- MesgRecord =
- record
- MesgNo, { Message number }
- SummLoc : Integer; { Summary index }
- TypMsg : Byte; { Message type }
- next : MesgPtr { Pointer to next element on list }
- end;
-
- {.F-}
-
- FilePtr = ^FileRecord;
- FileRecord =
- record
- fname : DosFileName; { Name of a matching file }
- index : Word; { Libraries only: location of file }
- fsize : LongInt; { Size of file }
- attrib : Byte; { Attributes of file }
- next : FilePtr { Pointer to next element on list }
- end;
-
- SectPtr = ^SectRecord;
- SectRecord =
- record
- SectDrive : Char; { Drive }
- SectUser, { User area }
- SectConf, { Conference number 1-7}
- SectAccs : Integer; { Access level required }
- SectName : DosFileName; { Section name }
- SectDesc : StrPr; { Description }
- next : SectPtr { Pointer to next element on list }
- end;
-
- AreaPtr = ^AreaRecord;
- AreaRecord =
- record
- Area, { Area number }
- AreaConf, { Conference number 1-7}
- AreaAccs : Integer; { Access level required }
- AreaName : DosFileName; { Message area name }
- AreaDesc : StrPr; { Description }
- next : AreaPtr { Pointer to next element on list }
- end;
-
- ArtPtr = ^ArtRecord;
- ArtRecord =
- record
- Artdrive : Char;
- ArtUser,
- ArtAccs,
- Artnum : Integer;
- ArtName : DosFileName;
- ArtDesc : strpr;
- Next : ArtPtr;
- end;
-
- NetAreaPtr = ^NetAreaRecord;
- NetAreaRecord =
- record
- AreaName : DosFileName;
- Next : NetAreaPtr;
- end;
-
- EntryBlock =
- record
- status : Byte;
- fname : name_array;
- index,
- fsize,
- CRC,
- CreationDate,
- LastChangeDate,
- CreationTime,
- LastChangeTime : Integer;
- PadCount : Byte;
- filler : array[27..31] of Byte
- end;
-
- user_list =
- record
- used : LongInt; { 4 }
- { Personal information }
- fn : firstname; { 11 }
- ln : lastname; { 16 }
- ad : address; { 21 }
- cy : city; { 21 }
- st : state; { 3 }
- ph : phone; { 13 }
- flags : Byte; { 1 }
- pw : password; { 11 }
- { User access }
- access : Byte; { 1 }
- limit : Byte; { 1 }
- { User configuration }
- nulls : Byte; { 1 }
- shift_lock : Boolean; { 1 }
- noisy : Boolean; { 1 }
- conf_flags : Byte; { 1 }
- columns : Byte; { 1 }
- lines : Byte; { 1 }
- { User stats }
- laston : tad_array; { 6 }
- time_today : Integer; { 2 }
- time_total : Integer; { 2 }
- lasthi : Integer; { 2 }
- upload : Word; { 2 }
- download : Word; { 2 }
- protocol : Char; { 1 }
- ratio : Byte; { 1 }
- last_read : last_read_arry; {128 }
- caca : Byte; { 1 }
- acct_bal : Integer { 2 }
- end; { Total 258 }
-
- sort_typ =
- record
- first : StrStd;
- second : StrStd;
- end;
-
- logr_list =
- record
- date : tad_array; { 6 }
- action : Byte; { 1 }
- user : Word; { 2 }
- Text : DosFileName { 13 }
- end; { Total 22 }
-
- summ_list =
- record
- date : tad_array; { 6 }
- status : record_status; { 1 }
- area : Byte; { 1 }
- num, { 2 }
- num_prev, { 2 }
- num_next, { 2 }
- user_from, { 2 }
- user_to : Integer; { 2 }
- subject : subject; { 56 }
- st_rec, { 2 }
- size : Integer { 2 }
- end; { Total 80 }
-
- stat_list =
- record
- date : tad_array; { 6 }
- busy_per_hour : hour_array; { 48 }
- busy_per_day : day_array; { 14 }
- end; { Total 68 }
-
- nwin_list =
- record
- date : tad_array; { 6 }
- status : record_status; { 1 }
- name : DosFileName; { 13 }
- user : Integer; { 2 }
- sectn : DosFileName; { 13 }
- descr : StrDesc; { 79 }
- PointValue : Word; { 2 }
- dnloads : Integer; { 2 }
- last_dnload : tad_array; { 6 }
- end; { Total 123 }
-
- sysm_list = StrStd; { Total 81 }
- mesg_list = message; { Total 73 }
-
- untype_file = file;
-
- {Arc File types}
-
- fntype = array[0..12] of Char;
- heads = record
- name : fntype;
- size : LongInt;
- date : Word;
- time : Word;
- crc : Word;
- Length : LongInt;
- end;
-
- var
- ExitSave : Pointer;
- NewinArea,
- NewinName : IndexFile;
- IdxF : IndexFile;
- DatF : DataFile;
- DispName : string;
-
- { Modem Globals }
-
- OKAY, RING, { result codes}
- connect300,
- connect1200,
- connect2400,
- connect9600,
- connect1200ecc,
- connect2400ecc,
- connect9600ecc,
- Error : StrPr;
- init_str : StrStd; { Command strings}
- off_hook_str,
- answer_str,
- hang_up_str : Str14;
- answer_delay,
- Attention,
- modem_rate : Integer;
- mnp, AllowMNP,
- modem_answer : Boolean;
-
- { System message global }
-
- SysmBase : SysmPtr; { Start of linked list }
- NetAreaBase : NetAreaPtr; { Start of linked list }
- Cmd_Queue : StrStd; { for multiple commands}
- mult_cmds : Boolean; { true when mult cmds exist}
- current_name : string[8];
- UserWantsScan : Boolean;
-
- { Section globals }
-
- SectBase : SectPtr; { Start of linked list }
- SectReq : DosFileName; { Section name }
- CreditType : UpCreditType; { Uploading credits method }
- UpCredit : Word; { New User upload credit }
- sort_rec : sort_typ; { Used by TurboSort }
- not_found : Integer; { }
-
- { Articles globals }
-
- Artbase : ArtPtr; { start of linked list}
-
- { Message area globals }
-
- AreaBase : AreaPtr; { Start of linked list }
- AreaReq : DosFileName; { Message area name }
- AreaSet : Integer; { Current message area }
- TempLastRead : last_read_arry;
-
- { Directory globals }
-
- DirBase : FilePtr; { Start of linked list }
- DirEntries : Word; { Count of directory entries }
- DirSpace : LongInt; { Disk space used }
-
- { Library globals }
-
-
- LibBase : FilePtr; { Start of linked list }
- LibEntries : Word; { Count of library entries }
- LibSpace : LongInt; { Space used }
- LibReq : DosFileName; { Library name }
-
- { Arc globals}
- ArcBase : FilePtr;
- ArcEntries : Word;
- ArcSpace : LongInt;
- ArcReq : DosFileName;
- Hdr : Heads;
- HdrVer : Byte;
- Endfile : Boolean;
- sizex : Integer;
-
- { Message system globals }
-
- MesgBase,
- MesgLast,
- MesgCurr,
- MesgPrev : MesgPtr; { Pointers }
- temp_hi_lmr, { Storage for lmr}
- msg_all, { Public message count }
- msg_ind, { Private message count }
- msg_aut, { Authored message count }
- msg_sys, { Sysop viewable message count }
- msg_hi, msg_lo : Integer; { High-low message numbers }
- nonstop : Boolean; { flag for continuous reading}
-
- { System globals }
- abort, { used to set brk from pause}
- audit_on, { Audit file enabled }
- cold, { Cold start }
- connected, { Connection established }
- delay_down, { Shutdown between users }
- fini, { Finished with TPBoard }
- in_library, { Library/section switch }
- in_arc, { Arc/section switch}
- in_use, { Successful login }
- local_copy, { Console display }
- local_online, { Local use allowed }
- new_dir, { New section or library selected }
- chat_ok, { allow chat function}
- down_ok, { allow downloads for new user }
- op_chat, { Operator requested chat }
- in_chat, { In chat mode }
- printer_copy, { Printer display }
- remote_copy, { Remote display }
- remote_online, { Remote use allowed }
- st_switch, { Size/time switch }
- up_down_display, { Up/download display }
- restrict300, { on/off flag}
- auto_macro, { on/off flag}
- macro_in_progress, { set while macro running}
- macro_file_exists, { optional, for auto macro }
- limit_lines, { on/off flag}
- restrict_public, { public msgs have to by approved}
- extra_time_sw, { extra time on sys on/off}
- valid_pw, { Correct password flag }
- disp_dir, { Auto display directory }
- format, { Force American phone format }
- fconsole : Boolean; { FansiConsole present flag }
- ch : Char; { Input character }
- HomDrv, { Default drive }
- RcvDrv, { Upload drive }
- SetDrv, { User selected drive }
- AudDrv : Str3; { Audit file drive}
- HomName,
- RcvName,
- SetName,
- AudName : strpr; { Path Names for above}
- CommandPath, { Full path to COMMAND.COM }
- DSZPath : string; { Full path to DSZ.COM }
-
- time_on, { Timers }
- time_left,
- extra_time,
- timeout,
- sleepy_time,
- last_time_left,
- mode, { Current mode of operation }
- start_restrict300, { hour to start restrictions}
- end_restrict300, { hour to end restrictions}
- auto_macro_start, { hour to start auto macro process}
- macro_done, { last day macro operated}
- max_msg_lines, { max. number of lines allowed}
- up_down_ratio, { numerator of ratio ie. 20:1}
- val_acc, { validated user access level}
- uval_acc, { unvalidated}
- uval_time, { same for unvalidated users}
- val_time, { time on sys limit - validated}
- chatstart, { hour sysop available}
- chatend, { end of chat available}
- unv_days, { retention of user listing}
- val_days, { retention of val users}
- unr_days, { message retention}
- rea_days, { same for after read}
- new_days, { days to age in Newin}
- maxfree_uplds, { variables to shut off or limit}
- maxfree_logs,
- maxfree_mslimit, { functions when too little disk}
- maxfree_lines,
- maxfree_abs, { space is left}
- extra_time_val, { for extra time on system}
- ExtraTimeStart,
- ExtraTimeStop,
- line_abort, { abort 'Type' after # of lines}
- max_tries : Integer; { counter}
- rate, { Current bps rate }
- time_count : Word;
- free_space, { Space remaining on current drive }
- user_loc : LongInt; { Location in data file of user record }
- input_time : Real; { for input timout routine}
- st, { general use input string}
- macro, { Automatic 'keyboard' input }
- Queue, { KeyBoard stuffing buffer }
- next_inpstr : StrStd; { Input string - used for word wrap }
-
- login_t : tad_array; { Login time }
-
-
- { Files }
-
- user_rec : user_list;
- dir_file,
- sort_file : Text;
-
- sysm_rec : sysm_list;
- sysm_file : file of sysm_list;
-
- summ_rec : summ_list;
- summ_file : file of summ_list;
-
- mesg_rec : mesg_list;
- mesg_file : file of mesg_list;
-
- logr_rec : logr_list;
- logr_file : file of logr_list;
-
- stat_rec : stat_list;
- stat_file : file of stat_list;
-
- nwin_rec : nwin_list;
- nwin_file : file of nwin_list;
-
- libr_file : file;
- arc_file : file;
- AuditFile : Text;
- config_file : Text;
- macro_file : Text;
- chl : Char;
- com : Text;
- lst : Text;
-
- type
-
- { Used for Fido Mail }
-
- msg_array = array[1..1024] of Integer;
- nam_array = array[1..36] of Char;
- date_array = array[1..20] of Char;
- subj_array = array[1..72] of Char;
- Str20 = string[20];
- Str36 = string[36];
- Str72 = string[72];
-
- name_arry = array[1..20] of Char;
- city_array = array[1..40] of Char;
-
- fido_msg_hdr =
- record
- msg_from : nam_array; { Who from }
- msg_to : nam_array; { Who to }
- subject : subj_array; { Subject }
- date : date_array; { Date of Message }
- times : Integer; { Number of times read }
- dest_node : Integer; { Destination Node }
- orig_node : Integer; { Originating Node }
- cost : Integer; { Cost in cents }
- orig_net : Integer; { Originating net }
- dest_net : Integer; { Destination net }
- caca : array[1..4] of Integer; { Extra space }
- prev_msg : Integer; { Thread to previous message }
- attr_low : Byte; { Message attributes }
- attr_high : Byte; { }
- next_msg : Integer { Thread to next message }
- end;
-
- net_lst_hdr =
- record
- net_num : Integer; { Network number }
- net_name : name_arry; { Name of Node }
- net_city : city_array; { Net Host location }
- node_ptr : Integer; { Pointer to node record }
- num_nodes : Integer; { How many nodes in net }
- end;
-
-
- node_lst_hdr =
- record
- node_num : Integer; { Node number }
- net_num : Integer; { Net number }
- node_cost : Integer; { Message cost }
- node_name : name_arry; { Name of Node }
- node_city : city_array; { City, State }
- end;
-
-
- Fido_Summ_Rec =
- record
- from_loc : LongInt;
- to_loc : LongInt;
- Number : Integer;
- end;
-
-
- { Used for the Quotes mod }
-
- quot_record = {structure of QUOTES.BB#}
- record
- Text : StrStd;
- end;
-
- qidx_record = {structure of QUOTEIDX.BB#}
- record
- loc : Integer;
- end;
-
- var
-
- { Used for the Quotes mod }
-
- quot_file : file of quot_record; { file var for QUOTES.BB# }
- quot_rec : quot_record;
- quot_count : Integer; { count of quotations in file }
- qidx_file : file of qidx_record; { file var for QUOTEIDX.BB# }
- qidx_rec : qidx_record;
-
- { Used for external protocols }
-
- ext_log : Text;
- ext_log_rec : StrStd;
- errcode : Integer;
- com_port : Byte;
- baud : string[4];
-
- { Used for Fido Mail }
-
- msg_hdr : fido_msg_hdr;
- net_hdr : net_lst_hdr;
- node_hdr : node_lst_hdr;
- summary_record : fido_summ_rec;
- fido_file : file of fido_msg_hdr;
- net_file : file of net_lst_hdr;
- node_file : file of node_lst_hdr;
- fido_summ_file : file of fido_summ_rec;
- fido_message,
- echo_file : Text;
- Byte_file,
- temp_file : file of Byte;
- cmd_tail : Boolean;
- num_params,
- time_to_event : Integer;
- dummy_subj,
- FidoArea : Str72;
- dummy_str,
- UserFullName : Str36;
- UserFirstName : FirstName;
- dummy_int,
- msg_offset,
- this_node,
- this_net,
- this_zone : Integer;
- fido_sysop : StrName;
- fidomail,
- fidolists : StrStd;
- fido : Boolean;
- NetMsgEntr,
- EchoMsgEntr : Word;
- temp_asciiz : Asciiz;
- msg_numbers : msg_array;
- first_scan : Boolean;
-
- { Used for ANSI Graphics }
-
- graphics : Boolean;
- question : Str72;
- hi, low, green,
- yellow, cyan,
- white : Str5;
-
- { Used for SYSOP menu password }
-
- menu_password,
- menu_temp : string[8];
-
- { Used for origin line }
-
- orig_file : Text;
- my_net,
- my_node,
- my_zone : Str10;
- orig_line,
- tear_line,
- sect_orig,
- seenby_line : string;
- {.F+}
-
- {==========================================================================}
-
- Implementation
-
- end. { of GLOBALS.PAS}
-